package com.ssm.util;

import org.junit.Test;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Component;

/**
 * Created by Lenovo on 2019-10-15.
 */
@Component("myBmw")
public class Car {
    @Value("BMW")
    private String type;
    @Value("500")
    private int maxSpeed;
    public Car() {   }
    public Car(String type, int maxSpeed) {
        this.type = type;
        this.maxSpeed = maxSpeed;    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public int getMaxSpeed() {
        return maxSpeed;
    }
    public void setMaxSpeed(int maxSpeed) {
        this.maxSpeed = maxSpeed;
    }
    public void introduce(){
        System.out.println("type is: "+ getType()+" ,maxSpeed is: "+getMaxSpeed());
    }
}
